from selenium.common import TimeoutException
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait


def wait_for_click(driver,by,value,time=10):
    try:
        WebDriverWait(driver,time).until(
            expected_conditions.element_to_be_clickable((by,value))
        )
        return True
    except TimeoutException:
        return False